package org.jackysoft.entity;

import org.hibernate.annotations.Type;
import org.jackysoft.entity.AbstractEntity;
import org.jackysoft.entity.User;
import org.joda.time.DateTime;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

@Entity
public class PlanItemModifiedRecord extends AbstractEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7789851427505974484L;

	private MonthPlanningItem host;
	private DateTime updateDate;
	private Double value = 0D;
	private User user;
	
	
	public PlanItemModifiedRecord() {
		super();
		// TODO Auto-generated constructor stub
	}
	
	
	public PlanItemModifiedRecord(MonthPlanningItem host,DateTime updateDate,Double value,User user) {
		this();
	    this.host = host;
	    this.updateDate = updateDate;
	    this.value = value;
	    this.user = user;
	}
	
	

	@ManyToOne
	public MonthPlanningItem getHost() {
		return host;
	}
	
	public void setHost(MonthPlanningItem host) {
		this.host = host;
	}
	
	@Type(type = "jodatime")
	public DateTime getUpdateDate() {
		return updateDate;
	}
	
	public void setUpdateDate(DateTime updateDate) {
		this.updateDate = updateDate;
	}
	public Double getValue() {
		return value==null?0D:value;
	}
	public void setValue(Double value) {
		this.value = value;
	}


	@ManyToOne
	public User getUser() {
		return user;
	}


	public void setUser(User user) {
		this.user = user;
	}
	
}
